package com.open.capacity.task.controller;

import com.open.capacity.common.web.Result;
import com.open.capacity.task.service.ReceiveTaskService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "ReceiveTask API")
@RequestMapping("/receiveTask")
public class ReceiveTaskController {
    @Autowired
    ReceiveTaskService receiveTaskService;

    /**
     * 用户接受id，存储用户与任务的关联，并判断是线上还是线下回答
     * @param tId
     * @param userId
     * @return
     */
    @PostMapping("/receive")
    public Result receive(Integer tId ,Integer userId){
        return receiveTaskService.receive(tId,userId);
    }
}
